package com.zmzncs.lmtc.module.customer.pojo.car;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.zmzncs.lmtc.common.pojo.enums.WhetherEnum;
import com.zmzncs.lmtc.common.util.EnumUtil;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 客户-车辆
 * </p>
 *
 * @author 任建波
 * @since 2020-08-31
 */
@Data
public class CarVO implements Serializable {

    private static final long serialVersionUID=1L;

    @ApiModelProperty(value = "id")
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long id;

    @ApiModelProperty(value = "客户Id")
    private Long customerId;

    @ApiModelProperty(value = "车牌号")
    private String carNumber;

    @ApiModelProperty(value = "车辆类型(0,燃油，1新能源)")
    private WhetherEnum carType;

    @ApiModelProperty(value = "是否上传到泊链（1：是, 0：否）")
    private WhetherEnum isToBolian;

    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @ApiModelProperty(value = "更新时间")
    private Date updateTime;

    public void setCarType(Integer carType) {
        WhetherEnum whetherEnum = EnumUtil.getByCode(carType, WhetherEnum.class);
        this.carType = whetherEnum;
    }

    public void setIsToBolian(Integer isToBolian) {
        WhetherEnum whetherEnum = EnumUtil.getByCode(isToBolian, WhetherEnum.class);
        this.isToBolian = whetherEnum;
    }

}
